﻿// *----------------------------------------------------------------
// Copyright (C) 2017 通通优品
// 版权所有。
// 
// 类名：SettingDefinition.cs
// 功能描述：TongTongMall
// 
// Create User：jym 2017/02/09
// 
// Edit User：UserName,EditTime
// Describe：Describe
// ----------------------------------------------------------------*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TongTongMall.Configuration
{
    public class SettingDefinition
    {
        /// <summary>
        /// 配置名称
        /// </summary>
        public string Name { get; private set; }

        /// <summary>
        /// 配置作用域
        /// </summary>
        public SettingScopes Scopes { get; private set; }
        
        /// <summary>
        /// 默认值
        /// </summary>
        public string DefaultValue { get; private set; }

        /// <summary>
        /// 自定义的数据
        /// </summary>
        public object CustomData { get; set; }

        public SettingDefinition(
            string name,
            string defaultValue,
            SettingScopes scopes = SettingScopes.Application,
            object customData = null)
        {
            if (string.IsNullOrEmpty(name))
            {
                throw new ArgumentNullException("name");
            }

            Name = name;
            DefaultValue = defaultValue;
            Scopes = scopes;
            CustomData = customData;
        }
    }
}
